class Solution:
    def findTheDifference(self, s: str, t: str) -> str:
        ahash = {}
        for i in s:
            if i not in ahash:
                ahash[i] = 0
            ahash[i] += 1
        for i in t:
            if i not in ahash:
                return i
            else:
                ahash[i] -= 1
                if ahash[i] == 0:
                    ahash.pop(i)
        return ahash.keys()[0]


if __name__ == '__main__':
    so = Solution()
    s = "abcd"
    t = "abcde"
    r = so.findTheDifference(s, t)
    print(r)
